package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.SystemDao;
import com.itheima.pojo.User;
import com.itheima.service.SystemService;
import com.itheima.util.MD5Utils;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;


@Service(interfaceClass = SystemService.class)
@Transactional
public class SystemServiceImpl implements SystemService {
    @Autowired
    private SystemDao systemDao;

    @Override
    public User findUsrByNameAndPsw(Map map) {
        String password = map.get("password").toString();
        map.put("password", MD5Utils.md5(password));
        return systemDao.findUsrByNameAndPsw(map);
    }
}
